package com.zzyl.controller.customer;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.entity.NursingLevel;
import com.zzyl.service.CustomerNursingProjectService;
import com.zzyl.vo.NursingLevelVo;
import com.zzyl.vo.NursingProjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description CustomerNursingProjectController
 * @Author Wen Jie
 * @Date 2024-09-14
 */
@Slf4j
@RestController
@RequestMapping("/customer/orders/project/")
@Api("小程序服务页面")
public class CustomerNursingProjectController extends BaseController{
    @Autowired
    private CustomerNursingProjectService customerNursingProjectService;
    @GetMapping("/page")
    public ResponseResult<PageResponse<NursingProjectVo>> page(@ApiParam(value = "护理项目名称")
                                                   @RequestParam(value = "name", required = false) String name,
                                               @ApiParam(value = "状态：0-禁用，1-启用")
                                                   @RequestParam(value = "status", required = false) Integer status,
                                               @ApiParam(value = "当前页码")
                                                   @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                               @ApiParam(value = "每页显示数量")
                                                   @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize){
        PageResponse<NursingProjectVo> nursingProjectVoPageResponse =customerNursingProjectService.getByPage(name,status,pageNum,pageSize);
        return success(nursingProjectVoPageResponse);
    }
    @GetMapping("id")
    @ApiOperation("根据id查询护理项目")
    public ResponseResult<NursingProjectVo> findById(@ApiParam(value = "护理项目id")
                                                    @RequestParam("id") Long id){
        NursingProjectVo nursingProjectVo = customerNursingProjectService.getById(id);
        return success(nursingProjectVo);
    }
}
